class Solution {
public:
    vector<string> removeAnagrams(vector<string>& words) {
        string base="";
        int k=0; //原地新数组大小
        for(auto &word:words)
        {
            string str=word;
            ranges::sort(str);
            if(str!=base) {
                base=str;
                words[k++]=word;
            }
        }
        words.resize(k);
        return words;
    }
};